package com.ipDev.moyvSys.controller;


import com.ipDev.moyvSys.domain.vo.BookVO;
import com.ipDev.moyvSys.service.IBookService;
import com.ipDev.moyvSys.utils.Code;
import com.ipDev.moyvSys.utils.Result;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author fish
 * @since 2024-10-26
 */
@RestController
@RequestMapping("/user/book")
@RequiredArgsConstructor
@Slf4j
public class UserBookController {

    private final IBookService bookService;

    @GetMapping("/list")
    public Result<List<BookVO>> list(){
      log.info("用户查看所有的书本");
      return Result.success(Code.GET_OK,"查询成功",bookService.listEnableBook());
    }
}
